//
//  FeedBackVC.m
//  Ginix
//
//  Created by ff on 2025/3/10.
//

#import "FeedBackVC.h"

@interface FeedBackVC ()
@property (nonatomic,strong) UILabel * nameLabel;
@property (nonatomic,strong) YYTextView * fiedView;
@property (nonatomic,strong) UIButton * enterBtn;
@end

@implementation FeedBackVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setSubViewLayout];
}

-(void)setSubViewLayout{
    
    self.title = @"问题反馈";
    [self.view addSubview:self.enterBtn];
    [self.view addSubview:self.fiedView];
    
}

-(void)enterBtnAction{
    
    if ([self.fiedView.text isEqual:@""]) {
        FhudShowStr(@"请输入问题描述");
        return;
    }
    FhudShowStr(@"提交成功");
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.navigationController popViewControllerAnimated:YES];
    });
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}

-(YYTextView *)fiedView{
    
    if (!_fiedView) {
        _fiedView = [[YYTextView alloc]initWithFrame:CGRectMake(20 * FMScaleX, NavHeight, WIDTH - 40 * FMScaleX, 200 * FMScaleX)];
        _fiedView.placeholderText = @"请输入问题描述";
        _fiedView.placeholderTextColor = RDRGB(0x999999);
        _fiedView.placeholderFont = Regular(17);
        
        _fiedView.textColor = RDRGB(0x333333);
        _fiedView.font = Regular(17);
        _fiedView.backgroundColor = UIColor.whiteColor;
        
        
    }
    return _fiedView;
}


-(UIButton *)enterBtn{
    
    if (!_enterBtn) {
        _enterBtn = [[UIButton alloc]initWithFrame:CGRectMake(30 * FMScaleX, HEIGHT - NavHeight - kSafeAreaHeight - 150 * FMScaleX, WIDTH - 60 * FMScaleX, 50 * FMScaleX)];
        [_enterBtn setBackgroundImage:[UIImage imageNamed:@"Login_enter_icon"] forState:UIControlStateNormal];
        [_enterBtn setTitle:@"确认" forState:UIControlStateNormal];
        [_enterBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
        [_enterBtn addTarget:self action:@selector(enterBtnAction ) forControlEvents:UIControlEventTouchUpInside];
        _enterBtn.titleLabel.font = Bold(20);
    }
    return _enterBtn;
}

@end
